# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-niaaml
_pkgorig=NiaAML
pkgver=1.1.12
pkgrel=2
pkgdesc="Python automated machine learning framework"
url="https://github.com/lukapecnik/NiaAML"
arch="noarch"
license="MIT"
depends="python3 py3-numpy py3-pandas py3-niapy py3-scikit-learn"
checkdepends="py3-pytest-xdist"
makedepends="py3-poetry-core py3-gpep517"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/lukapecnik/NiaAML/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/niaaml-$pkgver-py3-none-any.whl

	install -Dm644 docs/paper/10.21105.joss.02949.pdf -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 CITATION.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 COMPONENTS.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
4b30c6a3902a67dfb15216653db2403bef876ae00e6a2e0144d586cdb25535ab280e1c8af7ec88446cd2fcc99a2d3fefdd8874eb05cb8d083783a23014dadd5b  NiaAML-1.1.12.tar.gz
"
